const headers = require('./component/tab')

const home    = require('./page/home')
const product = require('./page/product')
const user    = require('./page/user')
const vip     = require('./page/vip')
const my      = require('./page/my')

const root = document.getElementById('root')
root.appendChild(headers.tab)

root.appendChild(home)
root.appendChild(product)
root.appendChild(user)
root.appendChild(vip)
root.appendChild(my)

const changeDom = [home,product,user,vip,my]

headers.tabClick((i,defaultIndex)=>{
    changeDom[defaultIndex].classList.remove('show')
    changeDom[i].classList.add('show')
})
